/**
 * create by young (young2f@outlook.com) on 2023/4/22
 * 简版的描述组
 * 传入:{label:value}
 */
'use strict';
import React, { Component } from 'react';
import { Layout, Descriptions } from 'antd';
import ViewTitle from '../ViewTitle';
const _=require('lodash')
class DescriptionGroupSimple extends Component {
  constructor(props) {
    super(props);
  }

  getItem = () => {
    const { labels } = this.props;
    const temp = [];
    _.map(labels,(value,key)=>{
      temp.push(
        <Descriptions.Item label={key}>
          {value}
        </Descriptions.Item>,
      );
    })

    return temp;
  };

  render() {
    const { title, subTitle, actions, size, style, column } = this.props;
    return (
      <div>
        {title && <ViewTitle
          title={title}
          subTitle={subTitle}
          style={style}
          actions={actions}
        ></ViewTitle>}
        <Descriptions size={size} bordered column={column}>
          {this.getItem()}
        </Descriptions>
      </div>

    );
  }
}

export default DescriptionGroupSimple;
